package com.anywide.controller.core;
import java.util.List;
import com.anywide.bean.user.User;
import com.anywide.dawdler.client.Transaction;
import com.anywide.dawdler.client.TransactionProvider;
import com.anywide.dawdler.clientplug.annotation.RequestMapping;
import com.anywide.dawdler.clientplug.annotation.RequestMapping.ViewType;
import com.anywide.dawdler.clientplug.web.TransactionController;
import com.anywide.dawdler.core.annotation.RemoteService;
import com.anywide.service.user.UserService;
public class IndexController extends TransactionController{
	@RemoteService()
	private UserService userService;   
	@RequestMapping(value = "/admin/index.html",viewType=ViewType.json,generateValidator=true)
	public void index() throws Exception {  
		System.out.println("demo....");
//		System.out.println(paramString("username")); 
//		System.out.println("admin/index....");  
		User user = new User();
		user.setUserid(5);
		user.setNickname("jackson.song");
		try {
			List<User> list = userService.selectUser(user);
			putData("list", list); 
		} catch (Exception e) {
			e.printStackTrace();
		}
	
//		 setTemplatePath("index.html");
		System.out.println("=====");
		setTemplatePath("index.html");
	}
	
	/**
	* <p>Title: login</p> 
	* @author cw 
	* @date 2017年10月19日 上午10:21:16 
	* @return void
	* <p>Description: 登录页面</p>  
	 
	*
	 */
	@RequestMapping(value = "/login.html")
	public void login() throws Exception {
		 setTemplatePath("admin/login.html");
	}
	

}
